package com.kosmos.dubhe.wxcp.provider;

import me.chanjar.weixin.cp.bean.message.WxCpMessage;
import me.chanjar.weixin.cp.bean.messagebuilder.BaseBuilder;


/**
 * @author wukai
 */

public enum MessageType {
    TEXT, MARKDOWN;

    public BaseBuilder<? extends BaseBuilder> build(Object param) {
        String t = this.toString();
        switch (t) {
            case "TEXT": {
                return WxCpMessage.TEXT().content(param.toString());
            }
            case "MARKDOWN": {
                return WxCpMessage.MARKDOWN().content(param.toString());
            }
            default:
                throw new IllegalArgumentException("not support " + t);
        }
    }
}
